﻿using System;
using System.Collections.Generic;
using System.Windows.Browser;

using SBPweb.RIA.Client.Contracts.Models;

namespace SBPweb.RIA.Client.Contracts.Base
{

    public class ScriptableModelProxyBase : IScriptableModel
    {

        private ScriptObject scriptObject;

        protected ScriptableModelProxyBase(ScriptObject scriptObject)
        {
            this.scriptObject = scriptObject;
        }

        protected void Invoke(string methodName, params object[] args)
        {
            scriptObject.Invoke(methodName, args);
        }

        // beacuse 'params object' is unable to handle by the ILGenerator
        protected void Invoke(string methodName, DynamicParameters dp)
        {
            Invoke(methodName, dp.ToArray());
        }
    }

    public class DynamicParameters : List<object>
    {
    }

}
